package com.antis.olsl.magic.efficiency.category;

import android.text.TextUtils;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.antis.olsl.arouterlib.MagicRoutePath;
import com.antis.olsl.base.BaseActivity;
import com.antis.olsl.base.utils.ToastUtil;
import com.antis.olsl.magic.databinding.ActivityCategoryEfficiencyDetailBinding;
import com.antis.olsl.magic.response.GetCategoryEfficiencyListResp;

import timber.log.Timber;

/**
 * 品类货效详情
 *
 * @author hhh
 */
@Route(path = MagicRoutePath.ACTIVITY_CATEGORY_EFFICIENCY_DETAIL)
public class CategoryEfficiencyDetailActivity extends BaseActivity<ActivityCategoryEfficiencyDetailBinding> {

    @Autowired
    GetCategoryEfficiencyListResp.ContentBean bean;

    @Override
    protected ActivityCategoryEfficiencyDetailBinding getViewBinding() {
        return ActivityCategoryEfficiencyDetailBinding.inflate(getLayoutInflater(), baseBinding.getRoot(), true);
    }

    @Override
    protected void initViews() {
        ARouter.getInstance().inject(this);
        Timber.tag("hhh").e("bean= " + bean);
        if (null == bean) {
            ToastUtil.showToast(this, "数据为空");
            return;
        }

        if (!TextUtils.isEmpty(bean.categoryName)) {
            viewBinding.textCategoryName.setText(bean.categoryName);
        }

        if (!TextUtils.isEmpty(bean.brandAmount)) {
            viewBinding.layoutBrandSales.textBrandAmount.setText(bean.brandAmount);
        }

        if (!TextUtils.isEmpty(bean.brandNumber)) {
            viewBinding.layoutBrandSales.textBrandNumber.setText(bean.brandNumber);
        }

        if (!TextUtils.isEmpty(bean.brandProfit)) {
            viewBinding.layoutBrandSales.textBrandProfit.setText(bean.brandProfit);
        }

        if (!TextUtils.isEmpty(bean.singleAmount)) {
            viewBinding.layoutSingleContribution.textSingleAmount.setText(bean.singleAmount);
        }

        if (!TextUtils.isEmpty(bean.singleNumber)) {
            viewBinding.layoutSingleContribution.textSingleNumber.setText(bean.singleNumber);
        }

        if (!TextUtils.isEmpty(bean.singleProfit)) {
            viewBinding.layoutSingleContribution.textSingleProfit.setText(bean.singleProfit);
        }

        if (!TextUtils.isEmpty(bean.singlePermeability)) {
            viewBinding.layoutOtherView.textOtherAmount.setText(bean.singlePermeability);
        }

        if (!TextUtils.isEmpty(bean.stockQuantity)) {
            viewBinding.layoutOtherView.textOtherNumber.setText(bean.stockQuantity);
        }

        if (!TextUtils.isEmpty(bean.stockAmount)) {
            viewBinding.layoutOtherView.textOtherProfit.setText(bean.stockAmount);
        }
    }

    @Override
    protected void initData() throws IllegalAccessException {

    }
}